package com.ddx.common.enums;

/**
 * @author dudianbo
 * @ClassName: ${CLASSNAME}
 * @Description: 是否
 * @date 2018/5/16
 */
public enum Whether {
    NO(0,"否"),
    YES(1,"是");
    private Integer code;
    private String msg;

    Whether(Integer code, String msg) {
        this.code=code;
        this.msg=msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static Whether getStatus(Integer code) {
        for (Whether t : Whether.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }
}
